<template>
	<view class="container">
		<view class="content">
			<header-view></header-view>
			<view v-html="Article.content"></view>
		</view>
	</view>
</template>

<script>
	import headerView from "@/components/headerView.vue"
	import {
		articleApi,
	} from '@/api/api.js'
	export default {
		components: {
			headerView
		},
		data() {
			return {
				delShow: false,
				form: {},
				Article: {},
			};
		},
		onLoad() {
			// 获取传递过来的参数
			const type = this.$route.query.type;
			console.log('type:', type);
			// 调用获取文章的方法
			this.getArticle(type);
		},
		methods: {
			getArticle(type) {
				const that = this;
				articleApi({
					type: type
				}).then(res => {
					that.Article = res.data.data[0];
					console.log(this.Article)
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		min-height: 100vh;
		height: auto;

		.content {
			padding-bottom: 40rpx;
			// position: relative;

			.title {
				padding-top: 60rpx;
				font-size: 30px;
				font-weight: 500;
				font-family: PM;
				line-height: 92rpx;
			}

			.text {
				padding-top: 40rpx;

				.text_title {
					font-size: 36rpx;
					font-weight: 600;
					font-family: PM;
					margin: 20rpx 0;
				}

				.text_content {
					margin-bottom: 10rpx;
				}
			}
		}
	}
</style>